#include "cRingDeny.h"

#include <sstream>
#include <Poco/DOM/Document.h>
#include <Poco/DOM/NodeIterator.h>
#include "misc/Interface.h"
#include "misc/Debug.h"
#include "client/Client.h"
#include "client/net/cAnnounce.h"
/*********************************************************/
void cRingDeny::execute()
{
	Interface& ui = Interface::Instance();
	ui << "Nameserver has no record of ring: " << name << std::endl;
	ui.flush();

	ack();
}
/*********************************************************/
std::string cRingDeny::serialize() const
{
	Client& c = Client::Instance();
	std::ostringstream		ostr;
	id = c.getID();

	ostr << "<GS id='" << id << "'>";
	ostr << "<RingDeny>" << name << "</RingDeny>";
	ostr << "</GS>";

	return( ostr.str() );
}
/*********************************************************/
void cRingDeny::deserialize(Poco::XML::NodeIterator& it)
{
	Poco::XML::Node* pNode = it.previousNode();
	name = pNode->innerText();
}
/*********************************************************/
std::string cRingDeny::getName() const
{
	return name;
}
/*********************************************************/
void cRingDeny::setName(const std::string& a)
{
	name = a;
}
/*********************************************************/
